Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch UnboundLocalError exception when EmailAlert fails connecting to the SMTP server #10244

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

amaltaro
Copy link
Contributor

@amaltaro amaltaro commented Jan 29, 2021

Fixes #10234

Status

ready

Description

This PR fixes a bug where the SMTP server connection call:

smtplib.SMTP(self.serverName)

fails, leaving the smtp variable unassigned, which then raises an exception in the finally block.
In short, make sure the smtp connection is properly cleared.

Is it backward compatible (if not, which system it affects?)

yes

Related PRs

none

External dependencies / deployment changes

none

@cmsdmwmbot
Copy link

Jenkins results:

  • Unit tests: succeeded
  • Pylint check: succeeded
    • 1 warnings
    • 1 comments to review
  • Pylint py3k check: succeeded
    • 0 errors and warnings that should be fixed
    • 0 warnings
    • 0 comments to review
  • Pycodestyle check: succeeded
    • 1 comments to review
  • Python3 compatibility checks: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/11103/artifact/artifacts/PullRequestReport.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MicroServices throw UnboundLocalError when sending email alerts from kubernetes/docker containers
2 participants